﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Theme="YUI"
    Inherits="YUI25_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <!-- Skin CSS file -->
    <link rel="stylesheet" type="text/css" href="../build/assets/skins/sam/layout.css">
    <link rel="stylesheet" type="text/css" href="../build/assets/skins/sam/resize.css">
    <!-- Utility Dependencies -->

    <script src="../build/yahoo-dom-event/yahoo-dom-event.js" type="text/javascript"></script>

    <script src="../build/dragdrop/dragdrop-min.js" type="text/javascript"></script>

    <script src="../build/element/element-beta-min.js" type="text/javascript"></script>

    <!-- Optional Animation -->

    <script src="../build/animation/animation-min.js" type="text/javascript"></script>

    <!-- Source file for the Resize Utility -->

    <script src="../build/resize/resize-beta-min.js" type="text/javascript"></script>

    <!-- Source file for the Layout Manager -->

    <script src="../build/layout/layout-beta-min.js" type="text/javascript"></script>

</head>
<body class=" yui-skin-sam">
    <form id="form1" runat="server">
    <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" ScriptMode="Release">
    </ajaxToolkit:ToolkitScriptManager>
    <div id="top1">
        
        <p>
            Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse justo nibh,
            pharetra at, adipiscing ullamcorper.</p>
    </div>
    <div id="bottom1">
        <p>
            Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse justo nibh,
            pharetra at, adipiscing ullamcorper.</p>
    </div>
    <div id="right1">
        <b>Right 1</b>
    </div>
    <div id="left1">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:GridView ID="gvStaff" runat="server" AllowPaging="True" AllowSorting="True"
                    AutoGenerateColumns="False" DataKeyNames="StaffId" DataSourceID="ldsStaff" SelectedIndex="0"
                    SkinID="WMGrid">
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" />
                        <asp:BoundField DataField="StaffId" HeaderText="StaffId" InsertVisible="False" ReadOnly="True"
                            SortExpression="StaffId" />
                        <asp:BoundField DataField="Firstname" HeaderText="Firstname" SortExpression="Firstname" />
                        <asp:BoundField DataField="Lastname" HeaderText="Lastname" SortExpression="Lastname" />
                    </Columns>
                </asp:GridView>
                <asp:LinqDataSource ID="ldsStaff" runat="server" ContextTypeName="WorkloadManagerDataContext"
                    OrderBy="Lastname" TableName="Staffs">
                </asp:LinqDataSource>
                <a href="Default2.aspx">sdfsdfsdf</a>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <div id="center1">
        <p id="toggle">
            <a href="#" id="tRight">Toggle Right</a><a href="#" id="tLeft">Toggle Left</a><a
                href="#" id="closeLeft">Close Left</a><a href="#" id="padRight">Add Gutter to Right</a></p>
        <ajaxToolkit:TabContainer ID="TabContSS" runat="server" ActiveTabIndex="0">
            <ajaxToolkit:TabPanel runat="server" HeaderText="Details" ID="tpDetails">
                <ContentTemplate>
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <asp:FormView ID="fvStaff" runat="server" DataKeyNames="StaffId" DataSourceID="ldsStaffMember"
                                DefaultMode="Edit">
                                <EditItemTemplate>
                                    StaffId:
                                    <asp:Label ID="StaffIdLabel1" runat="server" Text='<%# Eval("StaffId") %>' />
                                    <br />
                                    OldStaffId:
                                    <asp:TextBox ID="OldStaffIdTextBox" runat="server" Text='<%# Bind("OldStaffId") %>' />
                                    <br />
                                    Title:
                                    <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                                    <br />
                                    Firstname:
                                    <asp:TextBox ID="FirstnameTextBox" runat="server" Text='<%# Bind("Firstname") %>' />
                                    <br />
                                    Lastname:
                                    <asp:TextBox ID="LastnameTextBox" runat="server" Text='<%# Bind("Lastname") %>' />
                                    <br />
                                    IsCurrent:
                                    <asp:CheckBox ID="IsCurrentCheckBox" runat="server" Checked='<%# Bind("IsCurrent") %>' />
                                    <br />
                                    EmailAddress:
                                    <asp:TextBox ID="EmailAddressTextBox" runat="server" Text='<%# Bind("EmailAddress") %>' />
                                    <br />
                                    Phone:
                                    <asp:TextBox ID="PhoneTextBox" runat="server" Text='<%# Bind("Phone") %>' />
                                    <br />
                                    StaffNumber:
                                    <asp:TextBox ID="StaffNumberTextBox" runat="server" Text='<%# Bind("StaffNumber") %>' />
                                    <br />
                                    DateCreated:
                                    <asp:TextBox ID="DateCreatedTextBox" runat="server" Text='<%# Bind("DateCreated") %>' />
                                    <br />
                                    CreatedBy:
                                    <asp:TextBox ID="CreatedByTextBox" runat="server" Text='<%# Bind("CreatedBy") %>' />
                                    <br />
                                    DateUpdated:
                                    <asp:TextBox ID="DateUpdatedTextBox" runat="server" Text='<%# Bind("DateUpdated") %>' />
                                    <br />
                                    UpdatedBy:
                                    <asp:TextBox ID="UpdatedByTextBox" runat="server" Text='<%# Bind("UpdatedBy") %>' />
                                    <br />
                                    UnitOfferings:
                                    <asp:TextBox ID="UnitOfferingsTextBox" runat="server" Text='<%# Bind("UnitOfferings") %>' />
                                    <br />
                                    DivisionStaffs:
                                    <asp:TextBox ID="DivisionStaffsTextBox" runat="server" Text='<%# Bind("DivisionStaffs") %>' />
                                    <br />
                                    StaffTeachings:
                                    <asp:TextBox ID="StaffTeachingsTextBox" runat="server" Text='<%# Bind("StaffTeachings") %>' />
                                    <br />
                                    StaffSupervisions:
                                    <asp:TextBox ID="StaffSupervisionsTextBox" runat="server" Text='<%# Bind("StaffSupervisions") %>' />
                                    <br />
                                    <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
                                        Text="Update" />
                                    &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False"
                                        CommandName="Cancel" Text="Cancel" />
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    OldStaffId:
                                    <asp:TextBox ID="OldStaffIdTextBox" runat="server" Text='<%# Bind("OldStaffId") %>' />
                                    <br />
                                    Title:
                                    <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                                    <br />
                                    Firstname:
                                    <asp:TextBox ID="FirstnameTextBox" runat="server" Text='<%# Bind("Firstname") %>' />
                                    <br />
                                    Lastname:
                                    <asp:TextBox ID="LastnameTextBox" runat="server" Text='<%# Bind("Lastname") %>' />
                                    <br />
                                    IsCurrent:
                                    <asp:CheckBox ID="IsCurrentCheckBox" runat="server" Checked='<%# Bind("IsCurrent") %>' />
                                    <br />
                                    EmailAddress:
                                    <asp:TextBox ID="EmailAddressTextBox" runat="server" Text='<%# Bind("EmailAddress") %>' />
                                    <br />
                                    Phone:
                                    <asp:TextBox ID="PhoneTextBox" runat="server" Text='<%# Bind("Phone") %>' />
                                    <br />
                                    StaffNumber:
                                    <asp:TextBox ID="StaffNumberTextBox" runat="server" Text='<%# Bind("StaffNumber") %>' />
                                    <br />
                                    DateCreated:
                                    <asp:TextBox ID="DateCreatedTextBox" runat="server" Text='<%# Bind("DateCreated") %>' />
                                    <br />
                                    CreatedBy:
                                    <asp:TextBox ID="CreatedByTextBox" runat="server" Text='<%# Bind("CreatedBy") %>' />
                                    <br />
                                    DateUpdated:
                                    <asp:TextBox ID="DateUpdatedTextBox" runat="server" Text='<%# Bind("DateUpdated") %>' />
                                    <br />
                                    UpdatedBy:
                                    <asp:TextBox ID="UpdatedByTextBox" runat="server" Text='<%# Bind("UpdatedBy") %>' />
                                    <br />
                                    UnitOfferings:
                                    <asp:TextBox ID="UnitOfferingsTextBox" runat="server" Text='<%# Bind("UnitOfferings") %>' />
                                    <br />
                                    DivisionStaffs:
                                    <asp:TextBox ID="DivisionStaffsTextBox" runat="server" Text='<%# Bind("DivisionStaffs") %>' />
                                    <br />
                                    StaffTeachings:
                                    <asp:TextBox ID="StaffTeachingsTextBox" runat="server" Text='<%# Bind("StaffTeachings") %>' />
                                    <br />
                                    StaffSupervisions:
                                    <asp:TextBox ID="StaffSupervisionsTextBox" runat="server" Text='<%# Bind("StaffSupervisions") %>' />
                                    <br />
                                    <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                                        Text="Insert" />
                                    &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False"
                                        CommandName="Cancel" Text="Cancel" />
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    StaffId:
                                    <asp:Label ID="StaffIdLabel" runat="server" Text='<%# Eval("StaffId") %>' />
                                    <br />
                                    OldStaffId:
                                    <asp:Label ID="OldStaffIdLabel" runat="server" Text='<%# Bind("OldStaffId") %>' />
                                    <br />
                                    Title:
                                    <asp:Label ID="TitleLabel" runat="server" Text='<%# Bind("Title") %>' />
                                    <br />
                                    Firstname:
                                    <asp:Label ID="FirstnameLabel" runat="server" Text='<%# Bind("Firstname") %>' />
                                    <br />
                                    Lastname:
                                    <asp:Label ID="LastnameLabel" runat="server" Text='<%# Bind("Lastname") %>' />
                                    <br />
                                    IsCurrent:
                                    <asp:CheckBox ID="IsCurrentCheckBox" runat="server" Checked='<%# Bind("IsCurrent") %>'
                                        Enabled="false" />
                                    <br />
                                    EmailAddress:
                                    <asp:Label ID="EmailAddressLabel" runat="server" Text='<%# Bind("EmailAddress") %>' />
                                    <br />
                                    Phone:
                                    <asp:Label ID="PhoneLabel" runat="server" Text='<%# Bind("Phone") %>' />
                                    <br />
                                    StaffNumber:
                                    <asp:Label ID="StaffNumberLabel" runat="server" Text='<%# Bind("StaffNumber") %>' />
                                    <br />
                                    DateCreated:
                                    <asp:Label ID="DateCreatedLabel" runat="server" Text='<%# Bind("DateCreated") %>' />
                                    <br />
                                    CreatedBy:
                                    <asp:Label ID="CreatedByLabel" runat="server" Text='<%# Bind("CreatedBy") %>' />
                                    <br />
                                    DateUpdated:
                                    <asp:Label ID="DateUpdatedLabel" runat="server" Text='<%# Bind("DateUpdated") %>' />
                                    <br />
                                    UpdatedBy:
                                    <asp:Label ID="UpdatedByLabel" runat="server" Text='<%# Bind("UpdatedBy") %>' />
                                    <br />
                                    UnitOfferings:
                                    <asp:Label ID="UnitOfferingsLabel" runat="server" Text='<%# Bind("UnitOfferings") %>' />
                                    <br />
                                    DivisionStaffs:
                                    <asp:Label ID="DivisionStaffsLabel" runat="server" Text='<%# Bind("DivisionStaffs") %>' />
                                    <br />
                                    StaffTeachings:
                                    <asp:Label ID="StaffTeachingsLabel" runat="server" Text='<%# Bind("StaffTeachings") %>' />
                                    <br />
                                    StaffSupervisions:
                                    <asp:Label ID="StaffSupervisionsLabel" runat="server" Text='<%# Bind("StaffSupervisions") %>' />
                                    <br />
                                    <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"
                                        Text="Edit" />
                                </ItemTemplate>
                            </asp:FormView>
                            <asp:LinqDataSource ID="ldsStaffMember" runat="server" ContextTypeName="WorkloadManagerDataContext"
                                EnableUpdate="True" TableName="Staffs" Where="StaffId == @StaffId">
                                <WhereParameters>
                                    <asp:ControlParameter ControlID="gvStaff" DefaultValue="0" Name="StaffId" PropertyName="SelectedValue"
                                        Type="Int32" />
                                </WhereParameters>
                            </asp:LinqDataSource>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="gvStaff" EventName="SelectedIndexChanged" />
                        </Triggers>
                    </asp:UpdatePanel>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
            <ajaxToolkit:TabPanel ID="tpComments" runat="server" HeaderText="Comments">
                <ContentTemplate>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
            <ajaxToolkit:TabPanel ID="tpAddresses" runat="server" HeaderText="Address">
                <ContentTemplate>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
            <ajaxToolkit:TabPanel ID="tpTeaching" runat="server" HeaderText="Teaching">
                <HeaderTemplate>
                    Teaching
                </HeaderTemplate>
                <ContentTemplate>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
            <ajaxToolkit:TabPanel ID="tpPayments" runat="server" HeaderText="Payments">
                <HeaderTemplate>
                    Payments
                </HeaderTemplate>
                <ContentTemplate>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
        </ajaxToolkit:TabContainer>
    </div>
    </form>

    <script type="text/javascript">

(function() {
    var Dom = YAHOO.util.Dom,
        Event = YAHOO.util.Event;

    Event.onDOMReady(function() {
        var layout = new YAHOO.widget.Layout({
            units: [
                { position: 'top', height: 100, resize: false, body: 'top1',  gutter: '5px', collapse: true, resize: true },
                { position: 'right', header: 'Help', width: 300, resize: true, gutter: '5px', footer: 'Footer', collapse: true, scroll: true, body: 'right1', animate: false },
                { position: 'bottom', header: 'Bottom', height: 100, resize: true, body: 'bottom1', gutter: '5px', collapse: true },
                { position: 'left', header: 'Staff', width: 200, resize: true, body: 'left1', gutter: '5px', collapse: true, close: true, collapseSize: 50, scroll: true, animate: true },
                { position: 'center', body: 'center1' }
            ]
        });
        
        layout.on('render', function() {
            layout.getUnitByPosition('left').on('close', function() {
                closeLeft();
            });
        });
        layout.render();
        
        //collapse the right 
        layout.getUnitByPosition('right').collapse();
        
        Event.on('tLeft', 'click', function(ev) {
            Event.stopEvent(ev);
            layout.getUnitByPosition('left').toggle();
        });
        Event.on('tRight', 'click', function(ev) {
            Event.stopEvent(ev);
            layout.getUnitByPosition('right').toggle();
        });
        Event.on('padRight', 'click', function(ev) {
            Event.stopEvent(ev);
            var pad = prompt('CSS gutter to apply: ("2px" or "2px 4px" or any combination of the 4 sides)', layout.getUnitByPosition('right').get('gutter'));
            layout.getUnitByPosition('right').set('gutter', pad);
        });
        var closeLeft = function() {
            var a = document.createElement('a');
            a.href = '#';
            a.innerHTML = 'Add Left Unit';
            Dom.get('closeLeft').parentNode.appendChild(a);

            Dom.setStyle('tLeft', 'display', 'none');
            Dom.setStyle('closeLeft', 'display', 'none');
            Event.on(a, 'click', function(ev) {
                Event.stopEvent(ev);
                Dom.setStyle('tLeft', 'display', 'inline');
                Dom.setStyle('closeLeft', 'display', 'inline');
                a.parentNode.removeChild(a);
                layout.addUnit(layout.get('units')[3]);
                layout.getUnitByPosition('left').on('close', function() {
                    closeLeft();
                });
            });
        };
        Event.on('closeLeft', 'click', function(ev) {
            Event.stopEvent(ev);
            layout.getUnitByPosition('left').close();
        });
    });


})();
    </script>

</body>
</html>
